﻿@model MyDay.Models.Todo

@{
    ViewBag.Title = "Create a new todo";
}

<h2>Create a new todo</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Todo</legend>

        <input type="hidden" id="UserId" name="UserId" value="@Session["UserId"]" />

        <div class="editor-label">
            @Html.LabelFor(model => model.Subject)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Subject)
            @Html.ValidationMessageFor(model => model.Subject)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DueDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DueDate)
            @Html.ValidationMessageFor(model => model.DueDate)
        </div>

        <br />

        <label class="checkbox" for="IsComplete">Complete?
            @Html.EditorFor(model => model.IsComplete)
            @Html.ValidationMessageFor(model => model.IsComplete)
        </label>

        <br />

        <p>
            <input type="submit" value="Create" class="btn btn-large btn-success" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/javascript">
    $(document).ready(function () {
        //alert("A");
	    $("#DueDate").datepicker();
    });
</script>

          